package com.wondertek.poms.dao.vo;

import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.Data;

import java.util.List;

/**
 * @author gaozhengxing gaozhenghang@wondertek.com.cn
 * @date 2020/12/28 9:52
 * @description 树结构
 */
@Data
@JsonInclude(JsonInclude.Include.NON_NULL)
public class TreeVo {

    private String id;
    private String name;
    /**层级*/
    private int type;
    /**1级 默认0*/
    private String parentId;
    private String parentName;
    /** isShow 1：是勾选；0不勾选*/
    private int isShow;
    private TreeVo childrenTree;
    private List<TreeVo> children;

    public TreeVo(String id, String name, String parentId,String parentName, int type, int isShow, List<TreeVo> children) {
        this.id = id;
        this.name = name;
        this.type = type;
        this.parentId = parentId;
        this.parentName = parentName;
        this.isShow = isShow;
        this.children = children;
    }

    public void addChildrenTree(TreeVo tree){
        children.add(tree);
    }
    public void addChildrenList(List<TreeVo> list){
        children.addAll(list);
    }


}
